<template>
  <div class="elecSandTable">
    <component :is="pageType"></component>
  </div>
</template>
<script>
import constCommittee from "./constCommittee/constCommittee";
import constUnit from "./constUnit/constUnit";
export default {
  components: { constCommittee, constUnit },
  data() {
    return {
      pageType: "constUnit"
    };
  },
  methods: {
    getPageType() {
      if (JSON.parse(localStorage.getItem("userInfo")).company_type == 5) {
        this.pageType = "designUnit";
      } else if (
        JSON.parse(localStorage.getItem("userInfo")).company_type == 4
      ) {
        this.pageType = "constUnit";
      } else if (
        JSON.parse(localStorage.getItem("userInfo")).company_type == 3
      ) {
        this.pageType = "designUnit";
      } else {
        this.pageType = "constCommittee";
      }
    }
  },
    created(){
        this.getPageType()
    }
};
</script>
<style scoped lang="scss">
.elecSandTable {
  height: 100%;
  width: 100%;
  position: fixed;
  top: 0;
}
</style>